home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2002 #4 / K-CD-4-2002.ISO / Empire Earth / EEDemo.exe / Disk1 / data.ssa / unit ai scripts_aircraft carrier.tai < prev    next >
Encoding:
Text File  |  2001-09-29  |  2.1 KB  |  101 lines

  1. //
  2. // Aircraft Carrier AI File
  3. //
  4. // Behaviors:
  5. //
  6. //        Train units, research technology, open airport and launch planes at regular intervals
  7. //        Keep an eye out for enemy units, DO NOT pursue.
  8. //
  9. //
  10. //    Notes:
  11. //
  12. //
  13. //    Known Problems:
  14. //
  15. //
  16.  
  17.  
  18. Idle
  19. {
  20.     anyof(EnemyUnitSpotted,AirplaneAvailableToLaunch) true(AirportOpen)
  21. }
  22.  
  23. AirportOpen
  24. {
  25.     anyof(EnemyUnitDestroyed,UnitNotOnMap) true(SearchForSecondaryTarget)
  26.     AirplaneAvailableToLaunch true(WaitForTakeoffClearance)
  27.     NoMoreWaypoints false(Advance)
  28.     anyof(UnitFacingNotRequired,CompletedUnitFacing) true(TurnToUnitFacing)
  29. }
  30.  
  31. WaitForTakeoffClearance
  32. {
  33.     TakeoffClearanceGranted true(LaunchNextAirplane)
  34.     NoLaunchRequests true(AirportOpen)
  35.     NoMoreWaypoints false(Advance)
  36. }
  37.  
  38. LaunchNextAirplane
  39. {
  40.     LaunchedAirplane true(AirportOpen)
  41. }
  42.  
  43. SearchForSecondaryTarget
  44. {
  45.     SecondaryTargetFound true(AirportOpen) 
  46.     NoMoreWaypoints    true(Idle) false(Advance)
  47. }
  48.  
  49. // is pathfinding complete?
  50. PrepareToMove
  51. {
  52.     NoMoreWaypoints true(ReacquireGoal)
  53.     MovePreparationComplete true(Advance)
  54. }
  55.  
  56. // gets the next location
  57. GetNextAutoWaypoint
  58. {
  59.     UnitHasGoal true(PrepareToMove) false(Idle)
  60. }
  61.  
  62. // are we at a waypoint?
  63. Advance
  64. {
  65.     ArrivedAtMoveWaypoint true(GetNextMoveWaypoint)
  66.     AirplaneAvailableToLaunch  true(AirportOpen)
  67.     ObstacleDetected true(RepathAroundObstacle)    
  68. }
  69.  
  70. RepathAroundObstacle
  71. {
  72.     MovePreparationComplete true(Advance) false(Idle)
  73. }
  74.  
  75. // look for new waypoints and detect the end of the path
  76. GetNextMoveWaypoint
  77. {
  78.     ShouldMoveToNextAutoWaypoint true(GetNextAutoWaypoint)
  79.     NextWaypointRetrieved true(Advance) false(TurnToUnitFacing)
  80. }
  81.  
  82. // turn to unit facing as specified in the location goal, if required
  83. TurnToUnitFacing
  84. {
  85.     anyof(UnitFacingNotRequired,CompletedUnitFacing) true(ReacquireGoal)
  86.     AirplaneAvailableToLaunch  true(AirportOpen)
  87. }
  88.  
  89. FindUnexploredArea
  90. {
  91.     SearchingForAreaToExplore true(FindUnexploredArea)
  92.     NoUnexploredAreasLeft true(Idle) false(PrepareToMove)
  93. }
  94.  
  95. ReacquireGoal
  96. {
  97.     GoalIsExplore true(FindUnexploredArea) false(Idle)
  98. }
  99.  
  100. #include("Generic Death.tai")
  101.